package com.example.newcalculator3;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class MySqliteHelper extends SQLiteOpenHelper {
    private static final String TAG = "studentDB";

    //必要构造参数
    public MySqliteHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) {
        super(context, name, factory, version);
    }

    //第一次创建数据库时调用该方法
    public void onCreate(SQLiteDatabase db){
        //创建新表
        String sql = "create table student_table(TxtName TEXT,IntAge INTEGER,TxtEnrol TEXT)";
        db.execSQL(sql);
        //输出创建数据库的日志信息
        Log.i(TAG,"create Database OK!");
    }
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        Log.i(TAG,"update Database OK!");

    }
}
